package collection.homework;

import java.util.Set;
import java.util.TreeSet;

public class Demo05MyComparator {
    public static void main(String[] args) {
        Person[] people = new Person[]{
                new Person("liusan", 20, 90.0f),
                new Person("liusi", 22, 90.0f),
                new Person("wangwu", 20, 99.0f),
                new Person("sunliu", 22, 100.0f),
        };

        Set<Person> set = new TreeSet<>(new MyComparator());
        for (Person p : people) {
            set.add(p);
        }

        System.out.println(set);
    }
}
